/*
税前收入=工资+加班补贴
税后收入=税前收入-所得税额
所得税额 = 应纳税额 * 税率
*/

public class Employee {
    String name;
    double salary;
    double subsidy;
    double afterTax;
    double preTax;
    public double incomeTax(double salary,double subsidy){
        preTax=subsidy+salary;
        if(preTax>3500){
            double taxPayable=preTax-3500;
            if(taxPayable > 0 && taxPayable <= 500){
                afterTax=preTax-taxPayable*0.05;
            }else if(taxPayable > 500 && taxPayable <= 2000){
                afterTax=preTax-taxPayable*0.1;
            }else if(taxPayable > 2000 && taxPayable <= 5000){
                afterTax=preTax-taxPayable*0.15;
            }else if(taxPayable > 5000 && taxPayable <= 20000){
                afterTax=preTax-taxPayable*0.2;
            }else {
                afterTax=preTax-taxPayable*0.3;
            }
            return afterTax;
        }else {
            return preTax;
        }
    }

    public static void main(String[] args) {
        Employee employee=new Employee();
        employee.name="张三";
        double money=employee.incomeTax(5000,1000);
        System.out.println("姓名:"+employee.name);
        System.out.println("实得工资:"+money);
    }
}
